﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.Linq;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using NUnit.Framework;
using WW.NActiveRecord.Tests;
using WW.NActiveRecord.Tests.Models;
using WW.NActiveRecord.Attriutes;

namespace WW.NActiveRecord.Tests{
    [TestFixture]
    public class TestBasicUpdate :BaseTest {
        [SetUp]
        public  void SetUp()
        {
            base.SetUpDb(Table_Employees);
        }

        [Test]
        public void TestCreate(){
            Employee chen = new Employee("Chen","Peng");
            chen.EmployeeID.ShouldBe(0);
            chen.Save();
            chen.EmployeeID.ShouldNotBe(0,"gen id");
            Employee.Find(chen.EmployeeID).FirstName.ShouldBe("Chen");
        }

        //[Table(Name = "Categories")]
        //class Category:Base<Category>
        //{
        //    private EntitySet<Product> products = HasMany<Product>(owner => Product.All.Where(name=>owner.Record["x"]));

            
        //}
    }
}